package com.epam.giorgadze.task3.entity;

import com.epam.giorgadze.task3.entity.plane_type.Plane;

import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;

/**
 * User: Luka
 * Date: 07.02.14
 * Time: 18:19
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
        "airportName",
        "airCompanyID",
        "planes"
})
@XmlRootElement(name = "aircompany")

public class AirCompany {
    @XmlElement(required = true)
    private List<Plane> planes = new ArrayList<Plane>();
    @XmlElement(required = true)
    private String airportName;
    @XmlElement(required = true)
    private String airCompanyID;

    public AirCompany() {
    }

    public AirCompany(String ID) {
        setAirCompanyID(ID);
    }

    public AirCompany(List<Plane> planes, String airportName) {
        this.planes = planes;
        this.airportName = airportName;
    }

    public List<Plane> getPlanes() {
        return planes;
    }

    public void setPlanes(List<Plane> planes) {
        this.planes = planes;
    }

    public String getAirportName() {
        return airportName;
    }

    public void setAirCompanyName(String airportName) {
        this.airportName = airportName;
    }

    public String getAirCompanyID() {
        return airCompanyID;
    }

    public void setAirCompanyID(String airCompanyID) {
        this.airCompanyID = airCompanyID;
    }

    @Override
    public String toString() {
        return airportName + "\n" + airCompanyID + "\n" + planes;
    }

}
